
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- 避免IE使用兼容模式 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
<meta name="renderer" content="webkit" />
<title>主页</title>

<link rel="stylesheet" type="text/css" href="../../../plugins/bootstrap/3.3.7/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="../../../plugins/jquery-easyui/1.8.6/themes/bootstrap/easyui.css" />
<link rel="stylesheet" type="text/css" href="../../../plugins/jquery-easyui/1.8.6/themes/icon.css" />
<link rel="stylesheet" type="text/css" href="../../../plugins/bootstrap/3.3.7/css/bootstrap-theme.min.css" />
<link rel="stylesheet" href="../../../plugins/font-awesome/css/font-awesome.min.css" />
    
    
<link rel="stylesheet" type="text/css" href="../../../css/zbootstrap.css" />
<link rel="stylesheet" type="text/css" href="../../../css/zeasyui.css" />
<link rel="stylesheet" type="text/css" href="../../../css/common.css" />

<link rel="stylesheet" type="text/css" href="../../../plugins/codemirror/lib/codemirror.css" />
<link rel="stylesheet" type="text/css" href="../../../plugins/codemirror/theme/dracula.css" />
<link rel="stylesheet" type="text/css" href="../../../plugins/codemirror/addon/hint/show-hint.css" />
<link rel="stylesheet" type="text/css" href="../../../plugins/codemirror/addon/display/fullscreen.css">
<link rel="stylesheet" type="text/css" href="../../../plugins/codemirror/addon/dialog/dialog.css">
<link rel="stylesheet" type="text/css" href="../../../plugins/codemirror/addon/search/matchesonscrollbar.css">
    
<script type="text/javascript" src="../../../plugins/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="../../../plugins/jquery-rstorage/1.3.2/jquery.rStorage.min.js"></script>
<script type="text/javascript" src="../../../plugins/jquery-easyui/1.8.6/jquery.easyui.min.js"></script>
    
<script type="text/javascript" src="../../../plugins/codemirror/lib/codemirror.js"></script>
<script type="text/javascript" src="../../../plugins/codemirror/mode/sql/sql.js"></script>
<script type="text/javascript" src="../../../plugins/codemirror/addon/hint/show-hint.js"></script>
<script type="text/javascript" src="../../../plugins/codemirror/addon/hint/sql-hint.js"></script>
<script type="text/javascript" src="../../../plugins/codemirror/addon/hint/anyword-hint.js"></script>
<script type="text/javascript" src="../../../plugins/codemirror/addon/selection/selection-pointer.js"></script>
<script type="text/javascript" src="../../../plugins/codemirror/addon/display/autorefresh.js"></script>
<script type="text/javascript" src="../../../plugins/codemirror/addon/display/placeholder.js"></script>
<script type="text/javascript" src="../../../plugins/codemirror/addon/edit/matchbrackets.js"></script>

<script type="text/javascript" src="../../../js/zGlobal.js"></script>
<script type="text/javascript" src="../../../js/zApi.js"></script>
<script type="text/javascript" src="../../../js/zUtil.js"></script>
<script type="text/javascript" src="../../../js/zAlert.js"></script>
<script type="text/javascript" src="../../../js/zDict.js"></script>
<script type="text/javascript" src="../../../js/zTable.js"></script>
<script type="text/javascript" src="../../../js/zDialog.js"></script>
<script type="text/javascript" src="../../../js/zForm.js"></script>
    
    <![if IE]>

    <![endif]>

</head>
<body onload="noright(document.body);">

    <div id="p-all" class="easyui-layout" data-options="fit:true,border:false," style="border: 0px solid #D8D9E5;"> 
     <div data-options="region:'center',split:false,border:false,minWidth:200" style="overflow: hidden;width:50%;border-right:1px solid rgb(210, 208, 208);"> 
       <div style="height: 36px;padding:5px 3px;position: absolute;z-index: 2;right: 2px;">
        <input id="table-toggle" class="easyui-switchbutton" style="" />
       </div> 
      <table id="table-left"></table> 
     </div> 
     <div data-options="region:'east',split:true,border:false,minWidth:200" style="overflow: hidden;width:50%;border-left:1px solid rgb(210, 208, 208);"> 
      <table id="table-right"></table> 
     </div> 
    </div> 

  <!---分割-------------------------------------------------------------------------------->
  <div id="dlg-add-left" style="display:none;"> 
   <div class="main-content"> 
    <form>
     <div class="row">&nbsp;</div>
     <div class="row padding-right"> 
     <div class="col-sm-12"> 
          <div class="row" style="padding: 3px;"> 
           <fieldset style="border: 1px solid #e5e5e5;padding-bottom: 5px;"> 
              <legend class=" text-info">说明</legend>
              <span class="description-text">一般无需手动新增，使用项目信息中的“同步表”功能即可获取表数据</span>
           </fieldset>
          </div> 
     </div>
     <div class="col-sm-6"> 
      <label class="form-lable">所属项目</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="projectId" name="projectId" data-options="required:true" style="width:100%;" ></select>
      </div> 
     </div>
      <div class="col-sm-6"> 
      <label class="form-lable">加载标志</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="loadFlag" name="loadFlag" data-options="required:true,panelHeight:70" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">标题</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableTitle" name="tableTitle" data-options="required:true,prompt:'例如：用户信息'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">表编码</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableCode" name="tableCode" data-options="required:true,prompt:'例如：tbl_userinfo'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">原表编码</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableName" name="tableName" data-options="required:true,prompt:'例如：Tbl_UserInfo，大小写提高辨识度'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">驼峰CODE</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableJavaCode" name="tableJavaCode" data-options="required:true,prompt:'例如：UserInfo'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">驼峰CODE(全)</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableJavaFullCode" name="tableJavaFullCode" data-options="required:true,prompt:'例如：TblUserInfo'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">表别名</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableAlias" name="tableAlias" data-options="required:true,prompt:'例如：a'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">表注释</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableComment" name="tableComment" data-options="prompt:'例如：【用户信息表】用于存管控台系统用户信息',multiline:true,height:50" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">标签</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableTag" name="tableTag" data-options="prompt:'分类标签'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">排序</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="orderNum" name="orderNum" data-options="validType : ['number']" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">备注</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="remarks" name="remarks" data-options="multiline:true,height:50" style="width:100%;" /> 
      </div> 
     </div> 
     </div> 
    </form> 
   </div> 
  </div>


  <div id="dlg-edit-left" style="display:none;"> 
   <div class="main-content"> 
    <form>
     <div class="row">&nbsp;</div>
     <div class="row padding-right"> 
     <div class="col-sm-6"> 
      <label class="form-lable">表主键ID</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableId" name="tableId" data-options="required:true" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">所属项目</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="projectId" name="projectId" data-options="required:true" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">加载标志</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="loadFlag" name="loadFlag" data-options="required:true,panelHeight:70" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">标题</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableTitle" name="tableTitle" data-options="required:true,prompt:'例如：用户信息'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">表编码</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableCode" name="tableCode" data-options="required:true,prompt:'例如：tbl_userinfo'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">原表编码</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableName" name="tableName" data-options="required:true,prompt:'例如：Tbl_UserInfo，大小写提高辨识度'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">驼峰CODE</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableJavaCode" name="tableJavaCode" data-options="required:true,prompt:'例如：UserInfo'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">驼峰CODE(全)</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableJavaFullCode" name="tableJavaFullCode" data-options="required:true,prompt:'例如：TblUserInfo'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">表别名</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableAlias" name="tableAlias" data-options="required:true,prompt:'例如：a'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">表注释</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableComment" name="tableComment" data-options="prompt:'例如：【用户信息表】用于存管控台系统用户信息',multiline:true,height:50" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">标签</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="tableTag" name="tableTag" data-options="prompt:'分类标签'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">排序</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="orderNum" name="orderNum" data-options="validType : ['number']" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">备注</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="remarks" name="remarks" data-options="multiline:true,height:50" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">状态</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="dataStatus" name="dataStatus" data-options="multiple:false" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">创建用户ID</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="createOprid" name="createOprid" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">创建用户</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="createName" name="createName" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">创建时间</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="createTm" name="createTm" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">更新用户ID</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="lastUpdOprid" name="lastUpdOprid" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">更新用户</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="lastUpdName" name="lastUpdName" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">更新时间</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="lastUpdTm" name="lastUpdTm" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     </div> 
    </form> 
   </div> 
  </div>

  <div id="dlg-query-left" style="display:none;">
   <div class="main-content">
    <form>
     <div class="row padding-right">
     <div class="col-sm-12"> 
      <label class="form-lable">所属项目</label> 
      <div class="input-block">
        <select class="easyui-combobox" id="projectId" name="projectId" data-options="multiple:false" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">表主键ID</label> 
      <div class="input-block">
        <input class="easyui-textbox" id="tableId" name="tableId" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">表编码</label> 
      <div class="input-block">
        <input class="easyui-textbox" id="tableCode" name="tableCode" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">原表编码</label> 
      <div class="input-block">
        <input class="easyui-textbox" id="tableName" name="tableName" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     </div> 
    </form>
   </div>
  </div>
  <!---分割-------------------------------------------------------------------------------->
  <div id="dlg-add-right" style="display:none;">
   <div class="main-content"> 
    <form>
     <div class="row">&nbsp;</div>
     <div class="row padding-right"> 
     <div class="col-sm-12"> 
          <div class="row" style="padding: 3px;"> 
           <fieldset style="border: 1px solid #e5e5e5;padding-bottom: 5px;"> 
              <legend class=" text-info">说明</legend>
              <span class="description-text">一般无需手动新增，使用项目信息中的“同步表”功能即可获取表数据</span>
           </fieldset>
          </div> 
     </div>
     <div class="col-sm-6"> 
      <label class="form-lable">所属项目</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="projectId" name="projectId" data-options="required:true" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">表编码</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="tableCode" name="tableCode" data-options="required:true" style="width:100%;" ></select>
      </div> 
     </div> 
      <div class="col-sm-6"> 
      <label class="form-lable">标题</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnTitle" name="columnTitle" data-options="required:true,prompt:'例如：用户状态'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">字段编码</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnCode" name="columnCode" data-options="required:true,prompt:'例如：user_status'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">原字段编码</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnName" name="columnName" data-options="required:true,prompt:'例如：user_status'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">类型</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnDatatype" name="columnDatatype" data-options="required:true,prompt:'例如：varchar(2)'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">长度</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnLength" name="columnLength" data-options="prompt:'例如：2'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">小数</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnPrecision" name="columnPrecision" data-options="prompt:'例如：2'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">是否主键</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="columnPrimarykey" name="columnPrimarykey" data-options="required:true,panelHeight:70" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">是否为空</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="columnMandatory" name="columnMandatory" data-options="required:true,panelHeight:70" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">默认值</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnDefault" name="columnDefault" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">驼峰CODE</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnJavaCode" name="columnJavaCode" data-options="required:true,prompt:'userStatus'" style="width:100%;" /> 
      </div> 
     </div>
      <div class="col-sm-6"> 
      <label class="form-lable">排序</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="orderNum" name="orderNum" data-options="validType : ['number']" style="width:100%;" /> 
      </div> 
     </div> 
      <div class="col-sm-12"> 
      <label class="form-lable">字段注释</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnComment" name="columnComment" data-options="prompt:'例如：【用户状态】00正常、01停用、03锁定',multiline:true,height:50" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">备注</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="remarks" name="remarks" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">是否标准类型</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="standardFlag" name="standardFlag" data-options="required:true,panelHeight:70,prompt:'是否java基础类型'" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">JDBC类型</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="jdbcType" name="jdbcType" data-options="prompt:'例如：VARCHAR'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">JAVA类型</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="javaType" name="javaType" data-options="prompt:'例如：String'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">JAVA类型(全)</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="javaFullType" name="javaFullType" data-options="prompt:'例如：java.lang.String'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">JAVA扩展类型</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="javaVoType" name="javaVoType" data-options="prompt:'例如：String'" style="width:100%;" /> 
      </div> 
     </div> 
     </div> 
    </form> 
   </div> 
  </div>
  
  <div id="dlg-edit-right" style="display:none;">
   <div class="main-content"> 
    <form>
     <div class="row">&nbsp;</div>
     <div class="row padding-right"> 
     <div class="col-sm-6"> 
      <label class="form-lable">表字段主键ID</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnId" name="columnId" data-options="required:true" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">所属项目</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="projectId" name="projectId" data-options="required:true" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">所属表</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="tableCode" name="tableCode" data-options="required:true" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">标题</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnTitle" name="columnTitle" data-options="required:true,prompt:'例如：用户状态'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">字段编码</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnCode" name="columnCode" data-options="required:true,prompt:'例如：user_status'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">原字段编码</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnName" name="columnName" data-options="required:true,prompt:'例如：user_status'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">类型</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnDatatype" name="columnDatatype" data-options="required:true,prompt:'例如：varchar(2)'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">长度</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnLength" name="columnLength" data-options="prompt:'例如：2'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">小数</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnPrecision" name="columnPrecision" data-options="prompt:'例如：2'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">是否主键</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="columnPrimarykey" name="columnPrimarykey" data-options="required:true,panelHeight:70" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">是否为空</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="columnMandatory" name="columnMandatory" data-options="required:true,panelHeight:70" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">默认值</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnDefault" name="columnDefault" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">驼峰CODE</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnJavaCode" name="columnJavaCode" data-options="required:true,prompt:'userStatus'" style="width:100%;" /> 
      </div> 
     </div>
      <div class="col-sm-6"> 
      <label class="form-lable">排序</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="orderNum" name="orderNum" data-options="validType : ['number']" style="width:100%;" /> 
      </div> 
     </div> 
      <div class="col-sm-12"> 
      <label class="form-lable">字段注释</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="columnComment" name="columnComment" data-options="prompt:'例如：【用户状态】00正常、01停用、03锁定',multiline:true,height:50" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">备注</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="remarks" name="remarks" data-options="" style="width:100%;" /> 
      </div> 
     </div>
     <div class="col-sm-6"> 
      <label class="form-lable">是否标准类型</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="standardFlag" name="standardFlag" data-options="required:true,panelHeight:70,prompt:'是否java基础类型'" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">JDBC类型</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="jdbcType" name="jdbcType" data-options="prompt:'例如：VARCHAR'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">JAVA类型</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="javaType" name="javaType" data-options="prompt:'例如：String'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">JAVA类型(全)</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="javaFullType" name="javaFullType" data-options="prompt:'例如：java.lang.String'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">JAVA扩展类型</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="javaVoType" name="javaVoType" data-options="prompt:'例如：String'" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">状态</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="dataStatus" name="dataStatus" data-options="multiple:false" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">创建用户ID</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="createOprid" name="createOprid" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">创建用户</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="createName" name="createName" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">创建时间</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="createTm" name="createTm" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">更新用户ID</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="lastUpdOprid" name="lastUpdOprid" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">更新用户</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="lastUpdName" name="lastUpdName" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-6"> 
      <label class="form-lable">更新时间</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="lastUpdTm" name="lastUpdTm" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     </div> 
    </form> 
   </div> 
  </div>
  
  <div id="dlg-query-right" style="display:none;">
   <div class="main-content">
    <form>
     <div class="row padding-right">
     <div class="col-sm-12"> 
      <label class="form-lable">所属项目</label> 
      <div class="input-block">
        <select class="easyui-combobox" id="projectId" name="projectId" data-options="" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">所属表</label> 
      <div class="input-block">
        <select class="easyui-combobox" id="tableCode" name="tableCode" data-options="" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">字段主键ID</label> 
      <div class="input-block">
        <input class="easyui-textbox" id="columnId" name="columnId" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">字段编码</label> 
      <div class="input-block">
        <input class="easyui-textbox" id="columnCode" name="columnCode" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">原字段编码</label> 
      <div class="input-block">
        <input class="easyui-textbox" id="columnName" name="columnName" data-options="" style="width:100%;" /> 
      </div> 
     </div> 
     </div> 
    </form>
   </div>
  </div>

<div id="dlg-select-table-titles" style="display:none;">
   <div class="main-content">
    <form>
     <div class="row padding-right">
     <div class="col-sm-12"> 
          <div class="row" style="padding: 3px;"> 
           <fieldset style="border: 1px solid #e5e5e5;padding-bottom: 5px;"> 
              <legend class=" text-info">说明</legend>
              <span class="description-text">快速选择表标题和编码，方便后续复制使用</span>
           </fieldset>
          </div> 
     </div>
     <div class="col-sm-12"> 
    <div style="color: red;">名称集合：</div>
      <div style="padding-left: 20px;text-indent: 2rem;word-wrap: break-word;">
        <span name="titles" style="width:100%;" ></span>
      </div> 
      <div style="color: red;">编码集合：</div>
      <div style="padding-left: 20px;text-indent: 2rem;word-wrap: break-word;">
        <span name="codes" style="width:100%;" ></span>
      </div> 
      <div style="color: red;">编码集合2：</div>
      <div style="padding-left: 20px;text-indent: 2rem;word-wrap: break-word;">
        <span name="codes2" style="width:100%;" ></span>
      </div> 
      <div style="color: blue;">当前数量：<span name="counts" ></span></div>
      
     </div>
     </div> 
    </form>
   </div>
  </div>
  
  <div id="dlg-export-ddl" style="display:none;">
   <div class="main-content">
    <form>
     <div class="row padding-right">
     <div class="col-sm-12"> 
          <div class="row" style="padding: 3px;"> 
           <fieldset style="border: 1px solid #e5e5e5;padding-bottom: 5px;"> 
              <legend class=" text-info">说明</legend>
              <span class="description-text">快速导出整个项目的建表语句</span>
           </fieldset>
          </div> 
     </div>
     <div class="col-sm-12"> 
     &nbsp;
     </div>
    <div class="col-sm-12"> 
      <label class="form-lable">所属项目</label> 
      <div class="input-block">
        <select class="easyui-combobox" id="projectId" name="projectId" data-options="required:true,prompt:'选择要导出的项目'" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">ddl模板</label> 
      <div class="input-block">
        <select class="easyui-combobox" id="templateId" name="templateId" data-options="prompt:'为空时默认按优先级查找'" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">文件名</label> 
      <div class="input-block">
        <input class="easyui-textbox" id="fileName" name="fileName" data-options="prompt:'为空时默认为项目名'" style="width:100%;" ></input>
      </div> 
     </div>
     <div class="col-sm-12"> 
      <label class="form-lable">数据库类型</label> 
      <div class="input-block"> 
        <select class="easyui-combobox" id="databaseType" name="databaseType" data-options="prompt:'默认是项目数据库'" style="width:100%;" ></select>
      </div> 
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">是否转换类型</label> 
      <div class="input-block">
        <select class="easyui-combobox" id="convertFlag" name="convertFlag" data-options="required:true,prompt:'默认原样输出',value:'0',onChange:convertFlagChange1, panelHeight:70" style="width:100%;" ></select>
      </div> 
     </div> 
      <div class="col-sm-12"> 
      <label class="form-lable">类型转换规则</label> 
      <div class="input-block"> 
        <input class="easyui-textbox" id="convertRules" name="convertRules" data-options="readonly:true,multiline:true,height:50,prompt:'多个逗号分隔，格式：^var-vachar,^int-intger,blob-text,^num-number；或者声明长度：^num-number(%s,%s),^timestamp-timestamp(0)'" style="width:100%;" /> 
      </div> 
     </div> 
     </div> 
    </form>
   </div>
  </div>
  
  <div id="dlg-code-online-look" style="display:none;overflow: hidden;">
  <div class="main-content">
    <div class="easyui-layout" data-options="fit:true,border:false," > 
     <div data-options="region:'center',split:false,border:false" style="overflow: hidden;"> 
         <div style="height:100%;position: relative;border: 1px solid #D2D2D2;">
         <textarea id="fileContent" style="display: none;"></textarea>
         </div>
     </div> 
     <div data-options="region:'west',split:false,border:false,width:330" style="overflow: hidden;"> 
     <div class="col-sm-12"> 
       &nbsp;
     </div>
     <div class="col-sm-12"> 
      <label class="form-lable">ddl模板：<a href="javascript:void(0);" class="easyui-linkbutton" style="color: blue;" onclick="dlgOnlineLookCode();">刷新</a></label> 
        <select class="easyui-combobox" id="templateId" name="templateId" data-options="prompt:'为空时默认按优先级查找',onChange:function(){dlgOnlineLookCode();}" style="width:100%;" ></select>
     </div>
     <div class="col-sm-12"> 
      <label class="form-lable">数据库类型：</label> 
        <select class="easyui-combobox" id="databaseType" name="databaseType" data-options="prompt:'默认是项目数据库',onChange:function(){dlgOnlineLookCode();}" style="width:100%;" ></select>
     </div> 
     <div class="col-sm-12"> 
      <label class="form-lable">是否转换类型：</label> 
        <select class="easyui-combobox" id="convertFlag" name="convertFlag" data-options="required:true,prompt:'默认原样输出',value:'0',onChange:convertFlagChange2, panelHeight:70" style="width:100%;" ></select>
     </div> 
      <div class="col-sm-12"> 
      <label class="form-lable">类型转换规则：</label> 
        <input class="easyui-textbox" id="convertRules" name="convertRules" data-options="readonly:true,multiline:true,height:160,prompt:'多个逗号分隔，格式：^var-vachar,^int-intger,blob-text,^num-number；或者声明长度：^num-number(%s,%s),^timestamp-timestamp(0)'" style="width:100%;" /> 
     </div>
     </div>
   </div>
  </div>
  </div>
  
 <script>
  TableToggleFlag = true;//默认开启联动
  TableSelectFlag = null;//默认未选中
  DictNames = {};
  
  /* --分割------------------------------------------------------------------------------ */
  
  TitleLeft = "数据库表信息";
  IdDlgAddLeft = "#dlg-add-left";
  IdDlgEditLeft = "#dlg-edit-left";
  IdDlgQueryLeft = "#dlg-query-left";
  IdTableLeft = "#table-left";
  TableHeaderLeftMenu = null;
  
  /* --分割------------------------------------------------------------------------------ */
  
  TitleRight = "数据库表属性信息";
  IdDlgAddRight = "#dlg-add-right";
  IdDlgEditRight = "#dlg-edit-right";
  IdDlgQueryRight = "#dlg-query-right";
  IdTableRight = "#table-right";
  TableHeaderRightMenu = null;
  
  /* --分割------------------------------------------------------------------------------ */
  $(function(){
    loadDictToPage();//字典
    
    $('#table-toggle').switchbutton({
      checked:true,
      handleText:'明细',
      width:75,
      height:25,
      handleWidth:35,
      onChange:function(checked){
        if(checked){
          TableToggleFlag = true;
          $('#p-all').layout('expand','east');
        }else{
          TableToggleFlag = false;
          $('#p-all').layout('collapse','east');
        }
        $('#p-all .layout-expand.layout-expand-east').addClass('disabled');
      }
    });
    
    /* --分割------------------------------------------------------------------------------ */
    
    var urlLeft = zGlobal["http"] + "/autocode/table/list";
    var buttonsIdxLeft = [0,3,4];
    var buttonsFuncLeft = [dlgAddLeft,dlgDelLeftTable,dlgQueryLeft];
    var optionsLeft = {
            queryParams:{},
            url : urlLeft,
            idField: 'tableId',
            sortName: 'createTm',
            sortOrder: 'desc',
            multiSort: true,
            selectOnCheck: false,//单击单选框不要选中
            checkOnSelect: false,
            columns:[[
                {field: 'tableId', title: '表主键ID', align: 'center', width: 100, hidden: true},
                {field: 'projectId', title: '所属项目', align: 'center', width: 100,sortable: true, formatter: function(value,rowData,rowIndex){ return zUtil.dictConvertOfAutocode(value,"ZSELECT_PROJECT")}},
                {field: 'tableCode', title: '表编码', align: 'left',halign: 'center', width: 150 },
                {field: 'tableName', title: '原表编码', align: 'left',halign: 'center', width: 150, hidden: true},
                {field: 'loadFlag', title: '加载标志', align: 'center', width: 80, formatter: function(value,rowData,rowIndex){ return zUtil.dictConvertOfAutocode(value,"dict.booleanFlag")}},
                {field: 'tableAlias', title: '表别名', align: 'center', width: 60, hidden: true},
                {field: 'tableTag', title: '标签', align: 'center', width: 100, hidden: true},
                {field: 'orderNum', title: '排序', align: 'center', width: 50,sortable: true,},
                {field: 'dataStatus', title: '状态', align: 'center', width: 50, formatter: function(value,rowData,rowIndex){ return zUtil.dictConvertOfAutocode(value,"dict.dataStatus")}},
                {field: 'createName', title: '创建用户', align: 'center', width: 100},
                {field: 'createTm', title: '创建时间', align: 'center', width: 135,sortable: true},
                {field: ' ', title: ' ', align: 'center', width: 100},
            ]],
            frozenColumns:[[
             {field:'', title:'', align:'center', checkbox:true},
             {field:'buttonArr', title:'操作', align:'center', width: 60, formatter:buttonsFormatterLeft},
             {field: 'tableTitle', title: '标题', align: 'left',halign: 'center', width: 100},
            ]],
            onDblClickCell: function(rowIndex, field, value){
                if("buttonArr" != field){
                    dlgDtlLeft(rowIndex);
                }
            },
            onSelect: function(rowIndex, rowData){
              if(TableToggleFlag && (rowData['tableCode'] + rowData['projectId']) != TableSelectFlag){
                TableSelectFlag = (rowData['tableCode'] + rowData['projectId'])
                zUtil.formClear(IdDlgQueryRight + ' form');
                zUtil.val(IdDlgQueryRight + ' #projectId',rowData['projectId']);
                zUtil.val(IdDlgQueryRight + ' #tableCode',rowData['tableCode']);
                zUtil.readonly(IdDlgQueryRight + ' #projectId');
                zUtil.readonly(IdDlgQueryRight + ' #tableCode');
                zUtil.tableQuery(IdTableRight,{
                  'tableCode': rowData['tableCode']
                },{url:urlRight});
              }
            },
            onHeaderContextMenu: function(e, field){
              TableHeaderLeftMenu = zUtil.tableHeaderMenu(e,TableHeaderLeftMenu,IdTableLeft);
            },
            onRowContextMenu: function(e, rowIndex, rowData){
              e.preventDefault();
              zUtil.tableSelected(IdTableLeft,rowIndex);
              if(rowData != null){
                  dlgEditLeft(rowData);
              }
            },
            toolbar:[{
                    text:'获取表编码信息',
                    handler: function(){
                       dlgSelectTableTitles();
                    }
                },
                {
                    iconCls: 'fa fa-download fa-1',
                    text:'导出ddl',
                    handler: function(){
                       dlgExportDdl();
                    }
                }
           ]
            
    };
    zUtil.tableInit(IdTableLeft,optionsLeft,buttonsIdxLeft,buttonsFuncLeft);
    
    
    /* --分割------------------------------------------------------------------------------ */
    var urlRight = zGlobal["http"] + "/autocode/tableColumn/list";
    var buttonsIdxRight = [0,4];
    var buttonsFuncRight = [dlgAddRight,dlgQueryRight];
    var optionsRight = {
            queryParams:{},
            url : '',
            idField: 'columnId',
            sortName: 'createTm',
            sortOrder: 'desc',
            multiSort: true,
            columns:[[
                {field: 'columnId', title: '表字段主键ID', align: 'center', width: 100, hidden: true},
                {field: 'projectId', title: '所属项目', align: 'center', width: 100, hidden: true, formatter: function(value,rowData,rowIndex){return zUtil.dictConvertOfAutocode(value,"ZSELECT_PROJECT")}},
                {field: 'tableCode', title: '表编码', align: 'left',halign: 'center', width: 150, hidden: true},
                {field: 'columnCode', title: '字段编码', align: 'left',halign: 'center', width: 200},
                {field: 'columnName', title: '原字段编码', align: 'left',halign: 'center', width: 150, hidden: true},
                {field: 'columnDatatype', title: '类型', align: 'center', width: 150},
                {field: 'columnPrimarykey', title: '是否主键', align: 'center', width: 80, formatter: function(value,rowData,rowIndex){return zUtil.dictConvertOfAutocode(value,"dict.booleanFlag")}},
                {field: 'columnMandatory', title: '是否为空', align: 'center', width: 80, formatter: function(value,rowData,rowIndex){return zUtil.dictConvertOfAutocode(value,"dict.booleanFlag")}},
                {field: 'standardFlag', title: '标准类型', align: 'center', width: 80, formatter: function(value,rowData,rowIndex){return zUtil.dictConvertOfAutocode(value,"dict.booleanFlag")}},
                {field: 'orderNum', title: '排序', align: 'center', width: 50,sortable: true},
                {field: 'dataStatus', title: '状态', align: 'center', width: 50, formatter: function(value,rowData,rowIndex){return zUtil.dictConvertOfAutocode(value,"dict.dataStatus")}},
                {field: 'createName', title: '创建用户', align: 'center', width: 100},
                {field: 'createTm', title: '创建时间', align: 'center', width: 135,sortable: true},
                {field: ' ', title: ' ', align: 'center', width: 100},
            ]],
            frozenColumns:[[
//              {field:'', title:'', align:'center', checkbox:true},
             {field:'buttonArr', title:'操作', align:'center', width: 70, formatter:buttonsFormatterRight},
             {field: 'columnTitle', title: '标题', align: 'left',halign: 'center', width: 100},
            ]],
            onDblClickCell: function(rowIndex, field, value){
                if("buttonArr" != field){
                    dlgDtlRight(rowIndex);
                }
            },
            onSelect: function(rowIndex, rowData){
            },
            onHeaderContextMenu: function(e, field){
              TableHeaderRightMenu = zUtil.tableHeaderMenu(e,TableHeaderRightMenu,IdTableRight);
            },
            onRowContextMenu: function(e, rowIndex, rowData){
              e.preventDefault();
              zUtil.tableSelected(IdTableRight,rowIndex);
              if(rowData != null){
                  dlgEditRight(rowData);
              }
            },
    };
    zUtil.tableInit(IdTableRight,optionsRight,buttonsIdxRight,buttonsFuncRight);
    
    
    /* --分割------------------------------------------------------------------------------ */
  });
  
  function loadDictToPage(){
      var returnHandler = function(dict){
          zDictAutocode = dict;
          DictNames['ZSELECT_PROJECT'] = 'projectId';
          DictNames['dict.booleanFlag'] = 'loadFlag,standardFlag,columnMandatory,columnPrimarykey,convertFlag';
          DictNames['dict.dataStatus'] = 'dataStatus';
          DictNames['ZSELECT_DDL_TEMPLATE'] = 'templateId';
          DictNames['dict.databaseType'] = 'databaseType';
          
          var linkSelsetIds = [IdDlgQueryLeft,IdDlgAddLeft,IdDlgEditLeft,IdDlgQueryRight,IdDlgAddRight,IdDlgEditRight
            ,"#dlg-export-ddl","#dlg-code-online-look"];
          $.each(linkSelsetIds,function(i,item){
              zUtil.selectFill(item,DictNames,zDictAutocode);
          })
      };
      zUtil.dictLoadOfAutocode("dict.booleanFlag,dict.dataStatus,dict.databaseType,ZSELECT_PROJECT,ZSELECT_DDL_TEMPLATE"
          ,null,returnHandler);
  }
  
  /* --分割------------------------------------------------------------------------------ */
  
  //TODO
  function buttonsFormatterLeft(value,rowData,rowIndex){
    return '<a href="javascript:void(0)" class="easyui-linkbutton" onclick="dlgDelLeft('+rowIndex+');" title="删除" ><i class="fa fa-trash"> </i></a> '
          +'<a href="javascript:void(0)" class="easyui-linkbutton" onclick="dlgOnlineLookCode('+rowIndex+');" title="预览ddl" ><i class="fa fa-eye"> </i></a>';
  }
  //TODO
  function dlgQueryLeft(){
    var dlgSave = function(){
      var params = zUtil.valAll(IdDlgQueryLeft);
      zUtil.tableQuery(IdTableLeft,params);
      zUtil.tableData(IdTableRight,[]);
      zUtil.tableUnSelected(IdTableLeft);
      TableSelectFlag = null;
    };
    var dlgClear = function(){
      zUtil.formClear(IdDlgQueryLeft + ' form');
    };
    var dlgClose = function(){
      zUtil.dialogClose(IdDlgQueryLeft);
    };
    var dlgOptions = {
      title: TitleLeft + '-查询',
    };
    var dlgButtonsIdx = [0,1,2];
    var dlgButtonsFunc =  [dlgSave,dlgClear,dlgClose];
    zUtil.queryInit(IdDlgQueryLeft,dlgOptions,dlgButtonsIdx,dlgButtonsFunc);
    zUtil.dialogOpen(IdDlgQueryLeft);
  };
  //TODO
  function dlgQueryxLeft(){
    //zUtil.dialogOpen(IdDlgQueryxLeft);
  };
  //TODO
  function dlgAddLeft(){
    zUtil.formClear(IdDlgAddLeft + ' form');
    zUtil.readonlyAll(IdDlgAddLeft,false);
    zUtil.tableUnSelected(IdTableLeft);
    var dlgSave = function(){
      if(!zUtil.formCheck(IdDlgAddLeft +' form')){
        return false;
      };
      var params = zUtil.valAll(IdDlgAddLeft);
      var reqData = {reqData: params};
      zUtil.ajaxPost(zGlobal["http"] + "/autocode/table/add", reqData
      ,function(result){
        if(zCode["GLOBAL_SUCCESS"] == zUtil.getVal(result,zConst["busCode"])){
          var params = zUtil.valAll(IdDlgQueryLeft);
          zUtil.tableQuery(IdTableLeft,params);
          zUtil.dialogClose(IdDlgAddLeft);
        }else{
          zUtil.msg('保存失败'+(result.busMsg?'. '+result.busMsg:''));
        }
      });
    };
    var dlgClose = function(){
      zUtil.dialogClose(IdDlgAddLeft);
    };
    var dlgOptions = {
       title: TitleLeft + '-新增',
    };
    var dlgButtonsIdx = [0,1];
    var dlgButtonsFunc =  [dlgSave,dlgClose];
    zUtil.dialogInit(IdDlgAddLeft,dlgOptions,dlgButtonsIdx,dlgButtonsFunc);   
    zUtil.dialogOpen(IdDlgAddLeft);
  };
  //TODO  
  function dlgEditLeft(row){
    if($.isNumeric(row)){
        zUtil.tableSelected(IdTableLeft,row);
        row = zUtil.tableRows(IdTableLeft);
    }
    
    zUtil.formClear(IdDlgEditLeft + ' form');
    zUtil.readonlyAll(IdDlgEditLeft,false);
    zUtil.readonly(IdDlgEditLeft + ' #tableId');
    zUtil.readonly(IdDlgEditLeft + ' #projectId');
    zUtil.readonly(IdDlgEditLeft + ' #tableCode');
    zUtil.readonly(IdDlgEditLeft + ' #dataStatus');
    zUtil.readonly(IdDlgEditLeft + ' #createOprid');
    zUtil.readonly(IdDlgEditLeft + ' #createName');
    zUtil.readonly(IdDlgEditLeft + ' #createTm');
    zUtil.readonly(IdDlgEditLeft + ' #lastUpdOprid');
    zUtil.readonly(IdDlgEditLeft + ' #lastUpdName');
    zUtil.readonly(IdDlgEditLeft + ' #lastUpdTm');
    
    var dlgSave = function(){
      if(!zUtil.formCheck(IdDlgEditLeft +' form')){
        return false;
      };
      var params = zUtil.valAll(IdDlgEditLeft);
      var reqData = {reqData: params};
      zUtil.ajaxPost(zGlobal["http"] + "/autocode/table/edit", reqData
      ,function(result){
        if(zCode["GLOBAL_SUCCESS"] == zUtil.getVal(result,zConst["busCode"])){
          var params = zUtil.valAll(IdDlgQueryLeft);
          zUtil.tableQuery(IdTableLeft,params);
          zUtil.dialogClose(IdDlgEditLeft);
        }else{
          zUtil.msg('保存失败'+(result.busMsg?'. '+result.busMsg:''));
        }
      });
    };
    var dlgClose = function(){
      zUtil.dialogClose(IdDlgEditLeft);
    };
    var dlgOptions = {
      title: TitleLeft + '-编辑',
      onOpen : function(){
        var params = {};
        params['tableId']  = row['tableId'];
        zUtil.ajaxPost(zGlobal["http"] + "/autocode/table/detail", {reqData:params}
        ,function(result){
            if(zCode["GLOBAL_SUCCESS"] != zUtil.getVal(result,zConst["busCode"])){
              zUtil.msg('获取信息失败');
              return false;
            }
            zUtil.valAll(IdDlgEditLeft,result[zConst["resData"]]);
        });
      }
    };
    var dlgButtonsIdx = [0,1];
    var dlgButtonsFunc =  [dlgSave,dlgClose];
    zUtil.dialogInit(IdDlgEditLeft,dlgOptions,dlgButtonsIdx,dlgButtonsFunc);
    zUtil.dialogOpen(IdDlgEditLeft);
  };
  //TODO
  function dlgDtlLeft(row){
    if($.isNumeric(row)){
        zUtil.tableSelected(IdTableLeft,row);
        row = zUtil.tableRows(IdTableLeft);
    }
    
    zUtil.formClear(IdDlgEditLeft + ' form');
    zUtil.readonlyAll(IdDlgEditLeft);
          
    var dlgClose = function(){
      zUtil.dialogClose(IdDlgEditLeft);
    };
    var dlgOptions = {
      title: TitleLeft + '-详情',
      onOpen : function(){
        var params = {};
        params['tableId']  = row['tableId'];
        zUtil.ajaxPost(zGlobal["http"] + "/autocode/table/detail", {reqData:params}
        ,function(result){
            if(zCode["GLOBAL_SUCCESS"] != zUtil.getVal(result,zConst["busCode"])){
              zUtil.msg('获取信息失败');
              return false;
            }
            zUtil.valAll(IdDlgEditLeft,result[zConst["resData"]]);
        });
      }
    };
    var dlgButtonsIdx = [1];
    var dlgButtonsFunc =  [dlgClose];
    zUtil.dialogInit(IdDlgEditLeft,dlgOptions,dlgButtonsIdx,dlgButtonsFunc);
    zUtil.dialogOpen(IdDlgEditLeft);
  };
  //TODO
  function dlgDelLeft(row){
    if($.isNumeric(row)){
        zUtil.tableSelected(IdTableLeft,row);
        row = zUtil.tableRows(IdTableLeft);
    }
    
    var params = {}; 
    params['tableId']  = row['tableId'];
    var reqData = {reqData: params};
    var okfunc = function(){
    zUtil.ajaxPost(zGlobal["http"] + "/autocode/table/del", reqData
    ,function(result){
      if(zCode["GLOBAL_SUCCESS"] == zUtil.getVal(result,zConst["busCode"])){
        var params = zUtil.valAll(IdDlgQueryLeft);
        zUtil.tableQuery(IdTableLeft,params);
        zUtil.tableData(IdTableRight,[]);
      }else{
        zUtil.msg('操作失败'+(result.busMsg?'. '+result.busMsg:''));
      }
    });
    }
    zUtil.msgConfirm("确认删除已选中记录?",okfunc);
  };
  //TODO 
  function dlgDelLeftTable(){
    var row = zUtil.tableCheckRows(IdTableLeft);
    if(!row || row.length===0){
        zUtil.msg('请先勾选复选框');
        return false;
    }
    var params = {}; 
    var ids=[];
    $.each(row, function(i,rowx){
        ids.push(rowx['tableId']);
    });
    params['tableId']  = ids.join(",");
    var reqData = {reqData: params};
    var okfunc = function(){
      zUtil.ajaxPost(zGlobal["http"] + "/autocode/table/delTableAndColumn", reqData
      ,function(result){
        if(zCode["GLOBAL_SUCCESS"] == zUtil.getVal(result,zConst["busCode"])){
          var params = zUtil.valAll(IdDlgQueryLeft);
          zUtil.tableQuery(IdTableLeft,params);
          zUtil.tableData(IdTableRight,[]);
        }else{
          zUtil.msg('操作失败'+(result.busMsg?'. '+result.busMsg:''));
        }
      });
    }
    zUtil.msgConfirm("确认删除选中表和表字段?",okfunc);
  };
  
  /* --分割------------------------------------------------------------------------------ */
  //TODO
  function getTableLeft(){
      var rowLeft =  zUtil.tableRows(IdTableLeft);
      if(rowLeft == null || rowLeft.length == 0){
          zUtil.msg('未选择左侧数据');
          return null;
      }
      return rowLeft;
  }
  //TODO
  function buttonsFormatterRight(value,rowData,rowIndex){
    return '<a href="javascript:void(0)" class="easyui-linkbutton" onclick="dlgDelRight('+rowIndex+');" title="删除" ><i class="fa fa-trash"> </i></a> '
  }
  //TODO
  function dlgQueryRight(){
    var rowLeft = getTableLeft();
    if(rowLeft == null){
      return false;
    };
    zUtil.readonly(IdDlgQueryRight + ' #projectId');
    zUtil.readonly(IdDlgQueryRight + ' #tableCode');
    
    var dlgSave = function(){
      var params = zUtil.valAll(IdDlgQueryRight);
      zUtil.tableQuery(IdTableRight,params);
    };
    var dlgClear = function(){
      zUtil.formClear(IdDlgQueryRight + ' form');
      zUtil.val(IdDlgQueryRight + ' #projectId',rowLeft['projectId']);
      zUtil.val(IdDlgQueryRight + ' #tableCode',rowLeft['tableCode']);
    };
    var dlgClose = function(){
      zUtil.dialogClose(IdDlgQueryRight);
    };
    var dlgOptions = {
      title: TitleRight + '-查询',
    };
    var dlgButtonsIdx = [0,1,2];
    var dlgButtonsFunc =  [dlgSave,dlgClear,dlgClose];
    zUtil.queryInit(IdDlgQueryRight,dlgOptions,dlgButtonsIdx,dlgButtonsFunc);
    zUtil.dialogOpen(IdDlgQueryRight);
  };
  //TODO
  function dlgQueryxRight(){
    //zUtil.dialogOpen(IdDlgQueryxRight);
  };
  //TODO
  function dlgAddRight(){
    var rowLeft = getTableLeft();
    if(rowLeft == null){
      return false;
    };
    
    zUtil.formClear(IdDlgAddRight + ' form');
    zUtil.readonlyAll(IdDlgAddRight,false);
    zUtil.val(IdDlgAddRight + ' #projectId',rowLeft['projectId'])
    zUtil.val(IdDlgAddRight + ' #tableCode',rowLeft['tableCode'])
    zUtil.readonly(IdDlgAddRight + ' #projectId');
    zUtil.readonly(IdDlgAddRight + ' #tableCode');
    
    var dlgSave = function(){
      if(!zUtil.formCheck(IdDlgAddRight +' form')){
        return false;
      };
      var params = zUtil.valAll(IdDlgAddRight);
      var reqData = {reqData: params};
      zUtil.ajaxPost(zGlobal["http"] + "/autocode/tableColumn/add", reqData
      ,function(result){
        if(zCode["GLOBAL_SUCCESS"] == zUtil.getVal(result,zConst["busCode"])){
          var params = zUtil.valAll(IdDlgQueryRight);
          zUtil.tableQuery(IdTableRight,params);
          zUtil.dialogClose(IdDlgAddRight);
        }else{
          zUtil.msg('保存失败'+(result.busMsg?'. '+result.busMsg:''));
        }
      });
    };
    var dlgClose = function(){
      zUtil.dialogClose(IdDlgAddRight);
    };
    var dlgOptions = {
       title: TitleRight + '-新增',
    };
    var dlgButtonsIdx = [0,1];
    var dlgButtonsFunc =  [dlgSave,dlgClose];
    zUtil.dialogInit(IdDlgAddRight,dlgOptions,dlgButtonsIdx,dlgButtonsFunc);   
    zUtil.dialogOpen(IdDlgAddRight);
  };
  //TODO  
  function dlgEditRight(row){
    if($.isNumeric(row)){
      zUtil.tableSelected(IdTableRight,row);
      row = zUtil.tableRows(IdTableRight);
    }
    zUtil.formClear(IdDlgEditRight + ' form');
    zUtil.readonlyAll(IdDlgEditRight,false);
    zUtil.readonly(IdDlgEditRight + ' #columnId');
    zUtil.readonly(IdDlgEditRight + ' #projectId');
    zUtil.readonly(IdDlgEditRight + ' #tableCode');
    zUtil.readonly(IdDlgEditRight + ' #columnCode');
//     zUtil.readonly(IdDlgEditRight + ' #standardFlag');
//     zUtil.readonly(IdDlgEditRight + ' #jdbcType');
//     zUtil.readonly(IdDlgEditRight + ' #javaType');
//     zUtil.readonly(IdDlgEditRight + ' #javaFullType');
//     zUtil.readonly(IdDlgEditRight + ' #javaVoType');
    zUtil.readonly(IdDlgEditRight + ' #dataStatus');
    zUtil.readonly(IdDlgEditRight + ' #createOprid');
    zUtil.readonly(IdDlgEditRight + ' #createName');
    zUtil.readonly(IdDlgEditRight + ' #createTm');
    zUtil.readonly(IdDlgEditRight + ' #lastUpdOprid');
    zUtil.readonly(IdDlgEditRight + ' #lastUpdName');
    zUtil.readonly(IdDlgEditRight + ' #lastUpdTm');
          
    var dlgSave = function(){
      if(!zUtil.formCheck(IdDlgEditRight +' form')){
        return false;
      };
      var params = zUtil.valAll(IdDlgEditRight);
      var reqData = {reqData: params};
      zUtil.ajaxPost(zGlobal["http"] + "/autocode/tableColumn/edit", reqData
      ,function(result){
        if(zCode["GLOBAL_SUCCESS"] == zUtil.getVal(result,zConst["busCode"])){
          var params = zUtil.valAll(IdDlgQueryRight);
          zUtil.tableQuery(IdTableRight,params);
          zUtil.dialogClose(IdDlgEditRight);
        }else{
          zUtil.msg('保存失败'+(result.busMsg?'. '+result.busMsg:''));
        }
      });
    };
    var dlgClose = function(){
      zUtil.dialogClose(IdDlgEditRight);
    };
    var dlgOptions = {
      title: TitleRight + '-编辑',
      onOpen : function(){
        var params = {};
        params['columnId']  = row['columnId'];
        zUtil.ajaxPost(zGlobal["http"] + "/autocode/tableColumn/detail", {reqData:params}
        ,function(result){
            if(zCode["GLOBAL_SUCCESS"] != zUtil.getVal(result,zConst["busCode"])){
              zUtil.msg('获取信息失败');
              return false;
            }
            zUtil.valAll(IdDlgEditRight,result[zConst["resData"]]);
        });
      }
    };
    var dlgButtonsIdx = [0,1];
    var dlgButtonsFunc =  [dlgSave,dlgClose];
    zUtil.dialogInit(IdDlgEditRight,dlgOptions,dlgButtonsIdx,dlgButtonsFunc);
    zUtil.dialogOpen(IdDlgEditRight);
  };
  //TODO
  function dlgDtlRight(row){
    if($.isNumeric(row)){
      zUtil.tableSelected(IdTableRight,row);
      row = zUtil.tableRows(IdTableRight);
    }
    zUtil.formClear(IdDlgEditRight + ' form');
    zUtil.readonlyAll(IdDlgEditRight);
          
    var dlgClose = function(){
      zUtil.dialogClose(IdDlgEditRight);
    };
    var dlgOptions = {
      title: TitleRight + '-详情',
      onOpen : function(){
        var params = {};
        params['columnId']  = row['columnId'];
        zUtil.ajaxPost(zGlobal["http"] + "/autocode/tableColumn/detail", {reqData:params}
        ,function(result){
            if(zCode["GLOBAL_SUCCESS"] != zUtil.getVal(result,zConst["busCode"])){
              zUtil.msg('获取信息失败');
              return false;
            }
            zUtil.valAll(IdDlgEditRight,result[zConst["resData"]]);
        });
      }
    };
    var dlgButtonsIdx = [1];
    var dlgButtonsFunc =  [dlgClose];
    zUtil.dialogInit(IdDlgEditRight,dlgOptions,dlgButtonsIdx,dlgButtonsFunc);
    zUtil.dialogOpen(IdDlgEditRight);
  };
  //TODO
  function dlgDelRight(row){
    if($.isNumeric(row)){
      zUtil.tableSelected(IdTableRight,row);
      row = zUtil.tableRows(IdTableRight);
    }
    
    var params = {}; 
    params['columnId']  = row['columnId'];
    var reqData = {reqData: params};
    var okfunc = function(){
      zUtil.ajaxPost(zGlobal["http"] + "/autocode/tableColumn/del", reqData
      ,function(result){
        if(zCode["GLOBAL_SUCCESS"] == zUtil.getVal(result,zConst["busCode"])){
          var params = zUtil.valAll(IdDlgQueryRight);
          zUtil.tableQuery(IdTableRight,params);
        }else{
          zUtil.msg('操作失败'+(result.busMsg?'. '+result.busMsg:''));
        }
      });
    }
    zUtil.msgConfirm("确认删除已选中记录?",okfunc);
  };
  
  function dlgSelectTableTitles(){
      var rows=zUtil.tableCheckRows(IdTableLeft);
      if(!rows||rows.length===0){
          zUtil.msg('请先勾选表记录');
          return false;
      }
      var dlgClose = function(){
          zUtil.dialogClose('#dlg-select-table-titles');
        };
        var dlgOptions = {
          title: '当前表信息',
          width:'90%',
          height:'90%',
          maxWidth:'800',
          maxHeight:'400',
          onOpen:function(){
              var str1=null;
              var str2=null;
              var str3=null;
              $.each(rows,function(i,item){
                  if(!item['tableTitle']){
                     item['tableTitle']="unknown";
                  }
                  if(!item['tableJavaCode']){
                      item['tableJavaCode']="unknown";
                  }
                  if(!item['tableJavaFullCode']){
                      item['tableJavaFullCode']="unknown";
                  }
                  str1=str1==null?item['tableTitle']:(str1+","+item['tableTitle']);
                  str2=str2==null?item['tableJavaCode']:(str2+","+item['tableJavaCode']);
                  str3=str3==null?item['tableJavaFullCode']:(str3+","+item['tableJavaFullCode']);
              });
              var data={titles:str1,codes:str2,codes2:str3,counts:rows.length};
              zUtil.valAll('#dlg-select-table-titles',data);
          }
        };
        var dlgButtonsIdx = [1];
        var dlgButtonsFunc =  [dlgClose];
        zUtil.dialogInit('#dlg-select-table-titles',dlgOptions,dlgButtonsIdx,dlgButtonsFunc,true);
  }
  
  function dlgExportDdl(){
    var dlgSave = function(){
        if(!zUtil.formCheck("#dlg-export-ddl" +' form')){
          return false;
        };
        var params = zUtil.valAll("#dlg-export-ddl");
        zUtil.dialogClose("#dlg-export-ddl");
        var token = zConst['token'] + "=" +getToken();
        window.open(zGlobal["http"] + "/autocode/exportProjectDdl?"+token+"&"+ $.param(params));
    };
    
    var dlgClose = function(){
      zUtil.dialogClose("#dlg-export-ddl");
    };
    var dlgOptions = {
      title: TitleLeft + '-导出ddl',
      maxWidth: 600,
      maxHeight: 450,
      buttons: [{
              text:'下载',
              handler: function(){
                  dlgSave();
              }
            }
      ]
    };
    var dlgButtonsIdx = [1];
    var dlgButtonsFunc =  [dlgClose];
    zUtil.dialogInit("#dlg-export-ddl",dlgOptions,dlgButtonsIdx,dlgButtonsFunc);
    zUtil.dialogOpen("#dlg-export-ddl");
  }
  
  function dlgOnlineLookCode(row){
      if($.isNumeric(row)){
          zUtil.tableSelected(IdTableLeft,row);
          row = zUtil.tableRows(IdTableLeft);
      }else if(!row){
         row = zUtil.tableRows(IdTableLeft);
      }
      
      var JSInfoDlgEditor = null;
      
      var dlgClose = function(){
        zUtil.dialogClose('#dlg-code-online-look');
      };
      var dlgOptions = {
         title: '预览ddl',
         onOpen:function(){
             var editorObj = $('#dlg-code-online-look #fileContent').next('.CodeMirror');
             if(editorObj.length === 0){
                JSInfoDlgEditor = CodeMirror.fromTextArea($('#dlg-code-online-look #fileContent')[0], {
                     autoRefresh:true,
                     lineNumbers: true,
                     styleActiveLine: true,
                     matchBrackets: true,
                     lineWrapping: true,
                     theme: 'dracula',
                     hintOptions: {
                         completeSingle: false,  //关闭补全
                     },
                     mode: "sql",
                });
                JSInfoDlgEditor.setSize('100%','100%');
                JSInfoDlgEditor.on('keyup', () => {
                    //编译器内容更改事件
                    JSInfoDlgEditor.showHint();
                });
             }else{
                JSInfoDlgEditor = editorObj[0].CodeMirror;
             }
         }
      };
      var dlgButtonsIdx = [1];
      var dlgButtonsFunc =  [dlgClose];
      zUtil.dialogInit('#dlg-code-online-look',dlgOptions,dlgButtonsIdx,dlgButtonsFunc);
      zUtil.dialogOpen('#dlg-code-online-look');
      
      var params = zUtil.valAll("#dlg-code-online-look");
      params['tableId'] = row['tableId'];
      var detail = zUtil.ajaxPost(zGlobal["http"] + "/autocode/previewTableDdl", {reqData:params}
      ,function(detail){
          if(zCode["GLOBAL_SUCCESS"] != zUtil.getVal(detail,zConst["busCode"])){
              zUtil.msg('获取信息失败');
              return false;
          }
          detail = detail[zConst["resData"]];
          JSInfoDlgEditor.setValue(detail['fileContent']);  
      });
  }
  
  function convertFlagChange1(v){
      if(v == "1"){
           zUtil.readonly('#dlg-export-ddl #convertRules',false);
      }else{
           zUtil.readonly('#dlg-export-ddl #convertRules');
      }
  }
  function convertFlagChange2(v){
    if(v == "1"){
         zUtil.readonly('#dlg-code-online-look #convertRules',false);
    }else{
         zUtil.readonly('#dlg-code-online-look #convertRules');
    }
  }
  </script>

</body>
</html>